<div class="pageContent">

<form id="myform" method="post" action="{:U($module_name.'/save')}" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone);">

	{if $info['id']}
		<input type="hidden" name="id" value="{$info['id']}" />
	{/if}
	<div class="pageFormContent" layoutH="56" align="center">
		
		<dl>
			<dt><label>上级分类：</label></dt>
			<dd>
				<!--
				<input name="pcat.id" value="{$cats['parent_id']}" type="hidden"/>
				<input readonly="readonly" value="{$cats['name']}" postField="keyword" name="pcat.name" type="text" suggestFields="name" suggestUrl="{:U('Index/suggest',array('tn'=>'ProductCategoryTag','fn'=>'id,name'))}" lookupGroup="pcat"  />
				<a class="btnLook" href="{:U('Cat/lookup')}" lookupGroup="pcat" lookupPk="id" width="300" height="400">查找带回</a>
				-->
			
						<input id="inputcate1" name="cat.id"  value="{if $pinfo}{$pinfo.id}{else}{$info['parent_id']}{/if}"  type="hidden"/>
						<input class="required" name="cat.name" value="{if $pinfo}{$pinfo.name}{else}{$cats[$info['parent_id']]['name']}{/if}" type="text" postField="keywords" suggestFields="id,name" suggestUrl="{:U('Content/suggest',array('tn'=>'product_category_tag','fn'=>'id,name'))}" lookupGroup="cat"/><a class="btnLook" href="{:U('Cat/lookup',array('tn'=>'product_category_tag','fn'=>'id,name','where'=>myencode(array('status'=>1),1)))}" lookupGroup="cat">查找分类</a>
                        <span class="info">查找分类</span>
			
			</dd>
		</dl>
		
		<dl>
			<dt><label>名称：</label></dt>
			<dd>
				<input name="name" class="required" type="text" value="{$info['name']}" size="30" placeholder="请输入名称" style="float: none;width: 300px;" data-validate="validate(required);" />
				<input name="type" type="hidden" value="0"/>
			</dd>
		</dl>
	</div>
	<div class="formBar">
		<ul>
			<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
			<li>
				<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
			</li>
		</ul>
	</div>
</form>
</div>
<script>
    $(function(){
        $.ketchup.createErrorContainer(function(form, el) {
            return $('<ul/>', {
                    'class': 'ketchup-custom'
                    }).insertAfter(el);
        }).addErrorMessages(function(form, el, container, messages) {
            container.html('');

            for(i = 0; i < messages.length; i++) {
            $('<li/>', {
                text: messages[i]
            }).appendTo(container);
            }
        }).showErrorContainer(function(form, el, container) {
            container.slideDown('fast');
        }).hideErrorContainer(function(form, el, container) {
            container.slideUp('fast');
        });

        $('#myform').ketchup({
            validateEvents: 'blur keyup'
        });    
    })
</script>